<template>
  <h1>toRefs的使用</h1>
  <h2 v-text="name"></h2>
  <h2 v-text="age"></h2>
</template>

<script setup>
// toRefs: 把一个reactive响应式对象变成ref变量。
import { ref, isRef, unref, reactive, toRefs } from "vue";
let user = reactive({ name: "wc", age: 18 });
let { name, age } = toRefs(user);

console.log(isRef(name));
console.log(isRef(age));
</script>

<style lang="scss" scoped>
</style>